package com.hansheng.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by GoldenMan on 2017/5/22.
 */
@Entity
@Table(name = "tailing_detail", schema = "hansheng")
public class TailingDetailEntity {
    private int tailingDetailId;
    private Integer tailingId;
    private Integer msid;
    private Integer length;
    private Integer width;
    private Integer height;
    private Double weightThe;
    private Double weightAct;
    private Timestamp addTime;
    private int status;
    private Integer count;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "tailing_detail_id", nullable = false)
    public int getTailingDetailId() {
        return tailingDetailId;
    }

    public void setTailingDetailId(int tailingDetailId) {
        this.tailingDetailId = tailingDetailId;
    }

    @Basic
    @Column(name = "tailing_id", nullable = true)
    public Integer getTailingId() {
        return tailingId;
    }

    public void setTailingId(Integer tailingId) {
        this.tailingId = tailingId;
    }

    @Basic
    @Column(name = "msid", nullable = true)
    public Integer getMsid() {
        return msid;
    }

    public void setMsid(Integer msid) {
        this.msid = msid;
    }

    @Basic
    @Column(name = "length", nullable = true)
    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    @Basic
    @Column(name = "width", nullable = true)
    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    @Basic
    @Column(name = "height", nullable = true)
    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    @Basic
    @Column(name = "weight_the", nullable = true, precision = 0)
    public Double getWeightThe() {
        return weightThe;
    }

    public void setWeightThe(Double weightThe) {
        this.weightThe = weightThe;
    }

    @Basic
    @Column(name = "weight_act", nullable = true, precision = 0)
    public Double getWeightAct() {
        return weightAct;
    }

    public void setWeightAct(Double weightAct) {
        this.weightAct = weightAct;
    }

    @Basic
    @Column(name = "add_Time", insertable = false, nullable = false)
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "status", nullable = false)
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "count", nullable = true)
    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TailingDetailEntity that = (TailingDetailEntity) o;

        if (tailingDetailId != that.tailingDetailId) return false;
        if (status != that.status) return false;
        if (tailingId != null ? !tailingId.equals(that.tailingId) : that.tailingId != null) return false;
        if (msid != null ? !msid.equals(that.msid) : that.msid != null) return false;
        if (length != null ? !length.equals(that.length) : that.length != null) return false;
        if (width != null ? !width.equals(that.width) : that.width != null) return false;
        if (height != null ? !height.equals(that.height) : that.height != null) return false;
        if (weightThe != null ? !weightThe.equals(that.weightThe) : that.weightThe != null) return false;
        if (weightAct != null ? !weightAct.equals(that.weightAct) : that.weightAct != null) return false;
        if (addTime != null ? !addTime.equals(that.addTime) : that.addTime != null) return false;
        if (count != null ? !count.equals(that.count) : that.count != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = tailingDetailId;
        result = 31 * result + (tailingId != null ? tailingId.hashCode() : 0);
        result = 31 * result + (msid != null ? msid.hashCode() : 0);
        result = 31 * result + (length != null ? length.hashCode() : 0);
        result = 31 * result + (width != null ? width.hashCode() : 0);
        result = 31 * result + (height != null ? height.hashCode() : 0);
        result = 31 * result + (weightThe != null ? weightThe.hashCode() : 0);
        result = 31 * result + (weightAct != null ? weightAct.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + status;
        result = 31 * result + (count != null ? count.hashCode() : 0);
        return result;
    }
}
